home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
graphics
/
asprite.arc
/
ASPRITE.DOC
next >
Wrap
Text File
|
1988-08-09
|
9KB
|
200 lines
-----------------------------------------------------------------------------
ASPRITE V1.1
by
Bob Silliker
-----------------------------------------------------------------------------
ASPRITE is a program to create A-Line sprites interactively. The user is
presented with a simple menu driven interface that allows the user to create,
modify and save sprites. There are menu options to rotate, flip, shift,
insert, delete, clear, invert, paste and copy individual sprites. The user
also has direct access to the sprite attributes (xhot, yhot, colors etc)
for each sprite. The program can be used to create sprites for any of the
resolutions and can be executed in any resolution.
The program keeps all of the sprites in memory and will handle 512 sprites.
It does not create a backup file of the sprite file when saving so you should
keep copies of critical sprite files yourself.
The main reason sprited was written was to make it easy for sprites to be
included in C code. The program has an option to create C code out of the
sprites that have been defined. When the C code is compiled the resulting
sprite structures are properly initialized to the values set by the user.
The program displays a dialog on the left of the screen that displays the
bcolor, fcolor, mode, xhot and yhot for the current sprite. The colors and
hot spot position can be changed by clicking on one of the arrows in the
dialog. (NOTE: the up arrows on the hot spots actually decrease the hot
spot value which moves the hot spot up. This is a feature not a bug). The
program also displays the sprite and a blowup of the foreground pixels and
background pixels. Clicking on a pixel toggles it's color and sets all other
pixels the mouse touches to the new color while the mouse button is held
down. The Undo menu option will undo one draw operation.
There seems to be some confusion around what a sprite structure looks like.
I have seen documentation from Megamax that says the forecolor comes before
the backcolor and the ABACUS Internals book says the backcolor comes before
the forecolor. I have chosen to go with the ABACUS books definition of the
sprite structure.
When a C file is created, code is included that defines the sprite structure.
If the sprite structure has not been defined then my structure will be used.
There is also some confusion around what value to use in the sprite format
field. The VDI mode seems to work for values of 0 or 1 and the XOR works
for -1. I have chosen 1 for VDI and -1 for XOR. These can be changed
when the code is compiled. Just define what MY_VDI and MY_XOR should be
before the compiler gets to the code in the sprite C file. This can be
accomplished by using the -D option of the compiler. If you don't have
that option then you could include the sprite C file in one of the other C
files you have and define the macros MY_VDI and MY_XOR before the inclusion
of the sprite C file.
One final note about the A line colors. They don't seem to match the default
color indices you get from opening a virtual workstation. So I took out the
code that displays the foreground and background colors as you change the
bcolor and fcolor indices.
-----------------------------------------------------------------------------
DESK MENU OPTIONS
-----------------
About ASPRITE - you a get little dialog, nothing fancy, giving me credit
for this program and allowing anyone to use the program.
FILE MENU OPTIONS
-----------------
New - when you first execute ASPRITE the program allows you to
play with one sprite. When you actually want to start
real work (like saving it) click on this. The sprite
that you were playing with will become the first sprite.
Open - open an old asprite file for updating. The extention for
asprite is ASP. The program stores a signature at the
start of the file and will complain if it doesn't exist.
If everything is ok the file will be read in and the first
sprite in the file will be displayed.
Read - read the asprite file. The sprites in the file selected
will be inserted at the current sprite location.
Create C - create a C file of the sprites. The program will give
you a file selector dialog. Select the file you want to
create the C source in. If the file exists then the program
will prompt to over-write.
Save - save the file and do not exit the program. This menu
option will only be enabled if you used 'Open' or you
have executed a Save As.
Save As - save the file into a new asprite file. If the file exists
you will be prompted to over-write.
Close - close the sprite file. If you made changes then the
program will ask if you want to save it. If you do not
have a file yet (new) and you want to save it then it
will give a file selector dialog (see Save As).
Quit - quit the program. If you made changes then the program
will ask if you want to save it (see Close).
SPRITE MENU OPTIONS
-------------------
Add - add a sprite. A sprite will be added and will become the
current sprite. The new sprite is appended to the current
sprite. The sprite attributes and sprite contents will be
cleared.
Dup - duplicate the current sprite. This is the same as Add
except the sprite attributes and contents are copied from
the current sprite.
Copy - copy the current sprite to the sprite buffer. There is a
one sprite buffer that can be used to move sprites around.
Paste - copy from the sprite buffer into the current sprite. The
old sprite contents are over-written by the buffer sprite.
Delete - delete the current sprite. All of the sprites after the
current sprite will be shifted down one sprite.
PRIM MENU OPTIONS
-----------------
Backgrnd - the other prim operations now work on the background sprite.
This is a toggle that allows the user to either work with
the background or foreground of the sprite. Turning this
on turns off the Both flag below.
Both - the other prim operations now work on both the backgroud
and foreground of the sprite. This is useful for many of
the operations in the prim menu. Turning this on turns
off the Backgrnd flag above.
Clear - clear the current sprite attributes and contents.
Invert - change the ones to zeros and the zeros to ones in the sprite.
Shift - shift the sprite. The user will get a dialog that allows
shifting of the sprite in four directions.
Rot 90 - rotate the sprite 90 degrees clockwise.
H flip - flip the sprite horizontally.
V flip - flip the sprite vertically (make it upside down).
Copy - copy from the foreground to the background of the sprite.
If the Backgrnd menu option has been selected then it will
copy from the background to the foreground.
MISC MENU OPTIONS
-----------------
Undo - Undo the last operation. This works for all the menu
options that cause a change to the sprites. It does not
work for any of the File options.
Outline - display a box around the actual size sprite. The default
for this is to be on. Sometimes is nice to see the sprite
without the box around it.
Lines - darken the lines used to draw the sprite pixels. I think
that the default for this is to be on for color and off
for mono.
Hot Spot - display the hot spot on the sprite. The little 'x' that
appears in the sprite is the position of the hot spot.
The position of this spot is controlled by the lower
portion of the dialog on the left of the screen. This
option is selected when the program is first executed.
Color - set the vdi colors using a color palette dialog. The code
for this dialog I distributed as a library routine some
time ago. I include it in all my programs. When the
program terminates the color will be set back as it was
before the program was executed.
-----------------------------------------------------------------